import { axiosInstance } from "..";

function applySend(data:any){
  return new Promise((resolve,reject)=>{
    axiosInstance()
    .post("/material/apply/send",{data}).then(
        (res:any)=>{
            resolve(res)
        },
        (err:any)=>{
            reject(err)
        }
    )
  })
}

function getApplyDetail(docid:string){
    return new Promise((resolve,reject)=>{
        axiosInstance()
        .post("/material/apply/get",{docid})
        .then(
            (res:any)=>{
                resolve(res)
            },
            (err:any)=>{
                reject(err)
            }
        )
    })
}

function segmentCheck(segment:string){
    return new Promise((resolve,reject)=>{
        axiosInstance()
        .post("/material/apply/segmentcheck",{segment})
        .then(
            (res:any)=>{
                resolve(res)
            },
            (err:any)=>{
                reject(err)
            }
        )
    })
}

function segmentCheckPatch(segment:string){
    return new Promise((resolve,reject)=>{
        axiosInstance()
        .post("/material/apply/segmentcheckPatch",{segment})
        .then(
            (res:any)=>{
                resolve(res)
            },
            (err:any)=>{
                reject(err)
            }
        )
    })
}

export {
    applySend,
    getApplyDetail,
    segmentCheck,
    segmentCheckPatch
}